{{- if not .Values.upmeter.smokeMiniDisabled }}
{{- $context := . }}
{{- range $k, $v := .Values.upmeter.internal.smokeMini.sts }}
  {{- $sts := pluck $k $.Values.upmeter.internal.smokeMini.sts | first }}
  {{- if and (hasKey $sts "node") (hasKey $sts "zone") }}
---
apiVersion: v1
kind: Service
metadata:
  name: smoke-mini-{{ $k }}
  namespace: d8-{{ $.Chart.Name }}
  {{- include "helm_lib_module_labels" (list $context (dict "app" "smoke-mini")) | nindent 2 }}
spec:
  clusterIP: None
  ports:
  - name: http
    port: 8080
    protocol: TCP
  selector:
    smoke-mini: {{ $k }}
  {{- end }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
  name: smoke-mini
  namespace: d8-{{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list . (dict "app" "smoke-mini")) | nindent 2 }}
spec:
  clusterIP: None
  ports:
  - name: http
    port: 8080
    protocol: TCP
  selector:
    app: smoke-mini
---
apiVersion: v1
kind: Service
metadata:
  name: smoke-mini-cluster-ip
  namespace: d8-{{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list . (dict "app" "smoke-mini")) | nindent 2 }}
spec:
  # has cluster IP for kube-proxy/iptables packets path
  ports:
  - name: http
    port: 8080
    protocol: TCP
  selector:
    app: smoke-mini
{{- end }}
